<template>
  <div class="edu-page-warp">
    <div class="edu-page-title">
      <span style="padding-bottom: 10px">离校详情</span>
      <el-card shadow="never" body-style="padding: 24px;">
        <el-row :gutter="20" style="height: 50px;">
          <el-col v-for="item in items" :key="item.key" :span="6">
            <label class="el-form-item__label">{{item.label}} :</label>
            <span
              class="el-form-item__label"
              v-if="formatKeys.indexOf(item.key) > -1"
            >{{data[item.key] | formatDate('yyyy-MM-dd')}}</span>
            <span class="el-form-item__label" v-else>{{data[item.key]}}</span>
          </el-col>
        </el-row>
      </el-card>
    </div>
  </div>
</template>
<script>
import * as API from "common/src/api/leaveStudents";
export default {
  data() {
    return {
      items: [
        {
          label: "姓名",
          key: "name"
        },
        {
          label: "学号",
          key: "studentId"
        },
        {
          label: "年级",
          key: "grade"
        },
        {
          label: "学院",
          key: "facultyI18n"
        },
        {
          label: "专业",
          key: "professionI18n"
        },
        {
          label: "培养层次",
          key: "trainingLevelI18n"
        },
        {
          label: "培养类别",
          key: "studentCategoryI18n"
        },
        {
          label: "导师",
          key: "teacherName"
        },
        {
          label: "在校标识",
          key: "leaveSchoolI18n"
        },
        {
          label: "培养计划完成情况",
          key: "preStatus"
        },
        /*{
                label: '是否获取毕业证',
                key:''
            },{
                label: '毕业证发放时间',
                key: ''
            },{
                label: '是否获取学位证',
                key: ''
            },{
                label: '学位证发放时间',
                key: ''
            },*/ {
          label: "离校时间",
          key: "leaveTime"
        },
        {
          label: "操作人",
          key: "operatorId"
        },
        {
          label: "操作时间",
          key: "operatorTime"
        },
        {
          label: "操作IP地址",
          key: "ip"
        },
        {
          label: "离校原因",
          key: "leaveReason"
        }
      ],
      formatKeys: ["leaveTime", "operatorTime", "expectedGraduationDate"],
      data: {}
    };
  },
  mounted() {
    API.getLeaveStudentDetail(this.$route.params).then(
      response => {
        let { code, data } = response;
        if (code === 200) {
          this.data = data;
        }
      },
      xhr => {}
    );
  }
};
</script>
<style>
</style>
